const express = require('express');
const fs = require("fs")
const promisify = require('util').promisify;
const readFile = promisify(fs.readFile);
//创建服务器
const app =express();

app.get('/',async (req,res,next)=>{
  try{
    await readFile('./aaa.js')
  }catch(ex) {
    next(ex)
  }
})

//监听端口
app.listen(3000);
console.log('服务器启动成功')